home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
diskbuf.zip
/
DISKBUF.DOC
< prev
next >
Wrap
Text File
|
1987-05-18
|
13KB
|
306 lines
DISKBUF
A Program to Optimize the BUFFERS= Setting
by
W. G. Madison
W.G. Madison and Associates, Ltd.
8425 Greenbelt Rd. #101
Greenbelt MD 20770
301/552-9309
(CompuServe 73240,342)
May 15, 1987
Acknowledgment: This program is based upon ideas gleaned from the
public domain program THRASHER, by Monte Ferguson of Ravenna, OH.
Disclaimer: This program is provided AS IS, with no claim for
suitability for any particular purpose. Specifically, since the
program is necessarily extremely disk intensive and therefore
exercises the head positioning mechanism far more than is custom-
ary in normal use, the Author and W. G. Madison and Associates,
Ltd. disclaim any and all responsibility for actual and/or con-
sequential damages to hardware and/or files resulting from the
use of this program.
INTRODUCTION:
All personal computers using the DOS operating system (PC-
DOS, MS-DOS, etc.) use buffered I/O when reading from or writing
to the disk, unless the programmer who wrote the software being
used went to great lengths to avoid it. The number of buffers
used is specified in the file CONFIG.SYS, which is read at the
time the computer is booted up.
If you are not familiar with the CONFIG.SYS file or with the
concept of buffered I/O, it is strongly suggested that you refer
to your DOS reference manual before proceeding further.
The problem of determining the proper number of buffers with
which to configure a DOS computer is, at best, inadequately add-
ressed in most DOS reference manuals. Generally, the suggested
approach is "Try a number, then use your computer, then try
another number. Keep repeating this process until you are either
fed up or have arrived at something which gives acceptable per-
formance." Some reference manuals give a suggested value to be
used by those looking for an easy out. This suggested value may
or may not yield performance which is close to optimum.
DiskBuf provides a method for scanning through an entire
range of values while you go out for coffee (or something
stronger).
1
WHY WORRY ABOUT THE NUMBER OF BUFFERS?
As might be expected, buffering uses RAM. Specifically, each
buffer added to a DOS system uses 33 paragraphs (528 bytes) of
RAM. Assuming that plenty of RAM is available, it might be tempt-
ing to take the approach, "Let's just set the number of buffers
way up, and fly with that." Unfortunately, one can reach the
point where more time is spent searching buffers for information
than is necessary or desirable. A point of diminishing returns is
reached.
Similarly, too few buffers will cause the computer to go to
the disk more often than necessary. And, since disk operations
are dreadfully slow in comparison to memory operations, unaccept-
able performance degradation will result.
WHY USE THE DISKBUF PROGRAM TO SOLVE THE PROBLEM?
Basically, without an intimate knowledge of the insides of
DOS plus a penchant for solving complex mathematical problems,
there are three feasible methods for attacking the problem. The
first is to pick a number (based either upon your liking for
indulging in Russian roulette, or upon recommendations from
friends or the DOS reference manual) and put your trust in the
tooth fairy as to the appropriateness of the number. The second
is to try to determine the number by systematic trial and error,
editing your CONFIG.SYS file over a period of time. The third
method is to set up an automatic process which can sweep through
a series of values, perform a realistic test with each value, and
record the results for later analysis.
The DISKBUF program permits this third approach to be taken
easily. After using DISKBUF, you can readily determine the op-
timum number of buffers to be used, based not only upon time to
perform the test but also upon the amount of RAM occupied by the
buffers. You can decide, and have some rational basis for the
decision, whether you are willing to sacrifice X bytes of addi-
tional RAM in order to gain an additional Y% performance improve-
ment from your disk operations.
Sure beats flying by the seat of the pants, no?
HOW DO I USE DISKBUF?
Four files are included in the file DISKBUF.ARC. They are,
respectively:
2
DISKBUF.DOC (This file)
DISKBUF.COM (The operational program)
AUTOEXEC.BAT (A specimen AUTOEXEC file)
PLOTBUF.COM (A program to produce a screen
plot of the test results.
Duplicates code contained in
DISKBUF.COM)
Examine the AUTOEXEC.BAT file. You will see, as the last
line of the file, the line invoking DISKBUF. In the REMark lines
preceding this, you will see guidelines for setting the switch
values to be passed to DISKBUF. The switches are:
/TARGET: (Sets the disk to be tested)
/MAXBUF: (Sets the stopping point for the
test)
/MINBUF: (Sets the starting point for the
test)
/PLOT (If present, a screen plot of the
test results will be produced)
The first two switches, /TARGET: and /MAXBUF: are required;
the other two, /MINBUF: and /PLOT are optional.
/TARGET:xx takes as an argument a valid disk device
designator, with the appended colon being optional. This deter-
mines the device which is to be tested. (Required)
/MAXBUF:nn takes as an argument an integer between 1 and
99, and determines the greatest number of buffers to be used in
the test. (Required)
/MINBUF:nn also takes as an argument an integer between
1 and 99, and determines the starting number of buffers to be
used in the test. If this switch is omitted, a starting value of
3 will be used. (Optional)
/PLOT determines by its presence or absence whether
or not a screen plot of the test results will be produced at the
completion of the test. NOTE: If your computer does not have a
graphics card, this switch must not be included! (Optional)
To use DISKBUF, four steps are required.
STEP 1. Format a disk using the /S switch to make the disk
bootable.
STEP 2. Edit the AUTOEXEC.BAT file, to invoke DISKBUF with
the switch settings you want to be used.
STEP 3. Copy the edited AUTOEXEC.BAT file and the program
file DISKBUF.COM onto the disk prepared at Step 1.
STEP 4. Re-boot your computer.
3
STEP 5. Go to lunch, and come back in